<!--
 * @Description: ------------ fileDescription -----------
 * @Author: snows_l snows_l@163.com
 * @Date: 2024-09-19 15:01:50
 * @LastEditors: snows_l snows_l@163.com
 * @LastEditTime: 2025-01-29 14:53:40
 * @FilePath: /BLOG/src/components/Notice/index.vue
-->
<template>
  <div class="notice-container-wrap">
    <h2 class="title">NOTICE</h2>
    <div class="notice-content-padding">
      <div class="sub-title">公告</div>
      <div class="notice-content">
        <div class="scrolling-text">
          {{ notice }}
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { useAppStore } from '@/store/app';
import { ref, watch } from 'vue';
const appStore = useAppStore();
const notice = ref(appStore.projectConfig.notice);

watch(
  () => appStore.projectConfig.notice,
  n => {
    notice.value = n;
  },
  {
    deep: true,
    immediate: true
  }
);
</script>

<style lang="scss" scoped>
.notice-container-wrap {
  width: 100%;
  height: 100%;
  margin-bottom: 20px;
  .title {
    margin-bottom: 20px;
    text-shadow: var(--text-shadow);
  }
  .notice-content-padding {
    border-radius: var(--border-radius-1);
    padding: 0 10px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    background-color: #fcfcfc;
    .sub-title {
      text-wrap: nowrap;
      padding-right: 10px;
      color: #222222;
      font-size: 20px;
      font-weight: bold;
    }
    .notice-content {
      overflow: hidden;
      padding: 15px 20px;
      background-color: #111;
      background-image: radial-gradient(transparent 1px, #444 1px);
      background-size: 3px 3px;
      backdrop-filter: saturate(50%) blur(4px);
      border-top: 2px solid #fcfcfc;
      border-bottom: 2px solid #fcfcfc;
      .scrolling-text {
        font-size: 20px;
        white-space: nowrap;
        display: inline-block;
        padding-left: 100%;
        color: #00ff00; /* LED绿色 */
        // text-shadow: 0 0 5px #ff0000, 0 0 10px #ff0000, 0 0 15px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000, 0 0 40px #ff0000, 0 0 55px #ff0000, 0 0 75px #ff0000;
        animation: scrollText 24s linear infinite;
      }
    }
  }
}
@keyframes scrollText {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}
@keyframes swing {
  0% {
    transform: rotate(18deg);
  }
  100% {
    transform: rotate(-18deg);
  }
}
@keyframes changeColor {
  0% {
    filter: hue-rotate(180deg);
  }

  100% {
    filter: hue-rotate(360deg);
  }
}
</style>
